addTestClients()
{
	wait 5;

	for(;;)
	{
		if(getCvarInt("scr_testclients") > 0)
			break;
		wait 1;
	}

	testclients = getCvarInt("scr_testclients");
	for(i = 0; i < testclients; i++)
	{
		ent[i] = addtestclient();
		
		if (!isdefined(ent[i])) {
            println("Could not add test client");
            wait 1;
        }

		/*
		if(i & 1)
			team = "axis";
		else
			team = "allies";
		*/
		
		ent[i].pers["isBot"] = true;
        ent[i] thread TestClient("autoassign");
		
		//ent[i] thread TestClient(team);
	}
	//thread addTestClients();
}

TestClient(team)
{
	self endon("disconnect");

	while(!isdefined(self.pers["team"]))
		wait .05;

	self notify("menuresponse", game["menu_team"], team);
	wait 0.5;

	if(self.pers["team"]=="axis")
	{
		self notify("menuresponse", game["menu_weapon_axis"], "mp40_mp");
	}
	else
	{
		self notify("menuresponse", game["menu_team"], "allies");
		wait 0.5;
		if(game["allies"] == "russian")
			self notify("menuresponse", game["menu_weapon_allies"], "ppsh_mp");
		else if(game["allies"] == "british")
			self notify("menuresponse", game["menu_weapon_allies"], "sten_mp");
		else if(game["allies"] == "american")
			self notify("menuresponse", game["menu_weapon_allies"], "thompson_mp");
	}
}